package org.carl.component.job.enums


/**
 * @author xuxueli 2020-10-29 21:11:23
 */
enum class ScheduleTypeEnum(
    /**
     * schedule by fix delay (in seconds)， after the last time
     */
    /*FIX_DELAY(I18nUtil.getString("schedule_type_fix_delay"))*/
    val title: String
) {
    NONE("无"),

    /**
     * schedule by cron
     */
    CRON("CRON表达式"),

    /**
     * schedule by fixed rate (in seconds)
     */
    FIX_RATE("固定");

    companion object {
        fun match(name: String, defaultItem: ScheduleTypeEnum): ScheduleTypeEnum {
            for (item in values()) {
                if (item.name == name) {
                    return item
                }
            }
            return defaultItem
        }
    }

}